﻿using System;

namespace NthDownload.Common.Utils
{
    public class ExceptionUtils
    {
        /// <summary>
        /// Gets the inner most exception
        /// </summary>
        public static Exception GetInnerMostException(Exception ex)
        {
            if (ex == null)
            {
                return null;
            }

            if (ex.InnerException != null)
            {
                return GetInnerMostException(ex.InnerException);
            }

            return ex;
        }
    }
}
